﻿CREATE TABLE [dbo].[DocumenteDetaliuLink] (
    [IDDocDetaliuLink]  BIGINT          IDENTITY (1, 1) NOT NULL,
    [IDDocDetaliuSursa] BIGINT          NOT NULL,
    [IDDocDetaliuDest]  BIGINT          NOT NULL,
    [Tip]               CHAR (2)        DEFAULT ('ST') NOT NULL,
    [Cantitate]         DECIMAL (25, 5) DEFAULT ((0)) NULL,
    CONSTRAINT [PK_DocumenteDetaliuLink] PRIMARY KEY CLUSTERED ([IDDocDetaliuLink] ASC),
    CONSTRAINT [FK_DocumenteDetaliuLink_DocumenteDetaliu] FOREIGN KEY ([IDDocDetaliuSursa]) REFERENCES [dbo].[DocumenteDetaliu] ([IDDocumentDetaliu]),
    CONSTRAINT [FK_DocumenteDetaliuLink_DocumenteDetaliu1] FOREIGN KEY ([IDDocDetaliuDest]) REFERENCES [dbo].[DocumenteDetaliu] ([IDDocumentDetaliu])
);

